﻿@model Telerik.Web.Mvc.GridModel<ContactModel>
@using Telerik.Web.Mvc.UI
@using OperaHouse.Web.Areas.Admin.Models;
@{
    ViewBag.Title = "Thông tin liên hệ";
    var gridPageSize = OperaHouse.Configuration.GeneralSetting.AdminPageSize;
}

<div class="section-header">
    <div class="title">
        <img src="@Url.Content("~/Content/admin/images/ico-contact.png")" alt="" />
        Contact
    </div>
    <div class="options">
        
    </div>
</div>
<table class="adminContent">
    <tr>
        <td>
            @(Html.Telerik().Grid<ContactModel>()
                    .Name("contact-grid")
                    .BindTo(Model.Data)
                    .Columns(columns =>
                    {
                        columns.Bound(x => x.Name).Width("200px");
                        columns.Bound(x => x.Phone).Width("100px");
                        columns.Bound(x => x.Address).Width("300px");
                        columns.Bound(x => x.Email).Width("200px");
                        columns.Bound(x => x.Body).Encoded(false).Width("400px");
                        columns.Bound(x => x.CreatedOn).Width("150px");
                        columns.Bound(x => x.Id)
                            .Template(x => Html.ActionLink("Detail", "Detail", new { id = x.Id }))
                            .ClientTemplate("<a href=\"Detail/<#= Id #>\">Detail</a>")
                            .Width(50)
                            .HeaderTemplate("Detail")
                            .Filterable(false);
                    })
                    .Pageable(settings => settings.Total(Model.Total).PageSize(gridPageSize).Position(GridPagerPosition.Both))
                    .DataBinding(dataBinding => dataBinding.Ajax().Select("List", "Contact"))
                    .EnableCustomBinding(true))
        </td>
    </tr>
</table>

